package com.sfy.yxy.doctor.base;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author :creat by Xia燚
 * 时间：2020/11/22
 * 邮箱：XiahaotianV@163.com
 **/
public class ActivityCollector {
    //
    public static List<Activity> activities = new ArrayList<>();

    public static void addActivity(Activity activity) {
        activities.add(activity);
    }

    public static void removeActivity(Activity activity) {
        activities.remove(activity);
    }

    public static void finshAll() {
        for (Activity activity : activities) {
            //判断当前activity 是否被干掉！
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }

}
